package com.zuoye.zuoye4;

import java.util.Collections;
import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;

public class Test {
    public static void main(String[] args) {
        Set<Person> set = new TreeSet<>((o1, o2) -> {
            return o2.getIdCard() - o1.getIdCard();
        });
        set.add(new Person(154, "zhaoliu"));
        set.add(new Person(101, "zhangsan"));
        set.add(new Person(101, "zhangsan"));
        set.add(new Person(133, "wangwu"));
        set.add(new Person(115, "zhangsan"));
        set.add(new Person(115, "zhangsan"));
        set.add(new Person(112, "lisi"));
        set.forEach(System.out::println);

    }
}
